import React from 'react';
import { createApp } from 'ice';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';

// 设置接口服务根地址（分别为 调试环境接口根地址 和 生产环境接口根地址）
const baseURL = process.env.NODE_ENV === 'development' ? 'http://110.185.174.59:3000/mock/399' : './';

const appConfig = {
  app: {
    rootId: 'base-container',
    addProvider: ({ children }) => (<ConfigProvider locale={zhCN}>{children}</ConfigProvider>),
  },
  request: {
    baseURL
  },
  router: {
    type: 'hash',
    fallback: <div>加载中...</div>
  },
};

createApp(appConfig);
